package ihm;

import javax.swing.JFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import javax.swing.JButton;

public class IhmContrat {

	private JFrame frmGestionDesContrats;
	private JTextField txtReferenceContrat;
	private JTextField txtObjetContrat;
	private JTextField txtNomClient;

	/**
	 * Create the application.
	 */
	public IhmContrat() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		try {
			IhmContrat window = new IhmContrat();
			window.frmGestionDesContrats.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
		frmGestionDesContrats = new JFrame();
		frmGestionDesContrats.setTitle("Gestion de contrats");
		frmGestionDesContrats.setBounds(100, 100, 465, 180);
		frmGestionDesContrats.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JLabel lblReference = new JLabel("Référence :");
		
		JLabel lblObjet = new JLabel("Objet :");
		
		JLabel lblNomClient = new JLabel("Nom du client :");
		
		txtReferenceContrat = new JTextField();
		txtReferenceContrat.setColumns(10);
		
		txtObjetContrat = new JTextField();
		txtObjetContrat.setColumns(10);
		
		txtNomClient = new JTextField();
		txtNomClient.setColumns(10);
		
		JButton btnConfirmer = new JButton("Confirmer");
		
		JButton btnAnnuler = new JButton("Annuler");
		GroupLayout groupLayout = new GroupLayout(frmGestionDesContrats.getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(36)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addComponent(lblObjet)
						.addComponent(lblNomClient)
						.addComponent(lblReference))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(btnConfirmer, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
							.addGap(30)
							.addComponent(btnAnnuler, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
							.addContainerGap())
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(txtObjetContrat, 310, 310, 310)
								.addComponent(txtNomClient, 310, 310, 310)
								.addComponent(txtReferenceContrat, GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE))
							.addGap(36))))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(txtReferenceContrat, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblReference))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(txtObjetContrat, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblObjet))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(txtNomClient, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblNomClient))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnConfirmer)
						.addComponent(btnAnnuler))
					.addGap(70))
		);
		frmGestionDesContrats.getContentPane().setLayout(groupLayout);
	}
}
